package com.xxx.user.api;


import com.xxx.common.base.bo.ListResult;
import com.xxx.user.dto.RoleCreateReqDTO;
import com.xxx.user.dto.RoleGetAllReqDTO;
import com.xxx.user.dto.RoleGetAllResDTO;
import com.xxx.user.dto.RoleUpdateReqDTO;
import com.xxx.user.service.RoleService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
public class RoleApiImpl implements RoleApi {

    private final RoleService roleService;

    @Override
    public String create(@RequestBody RoleCreateReqDTO param) {
        return roleService.create(param);
    }

    @Override
    public String update(@RequestBody RoleUpdateReqDTO param) {
        return roleService.update(param);
    }

    @Override
    public String delete(@RequestBody List<Long> ids) {
        return roleService.delete(ids);
    }

    @Override
    public ListResult<RoleGetAllResDTO> getAll(@SpringQueryMap RoleGetAllReqDTO param) {
        return roleService.getAll(param);
    }
    
}
